
cc.Class({
    extends: cc.Component,

    properties: {
        guang:cc.Node
    },

    onLoad () {
        this.time = 0;
        this.move = true;

        this.guangAnim();
        // var rby = cc.rotateBy(1,30);
        // this.node.runAction(rby);

    },
    guangAnim(){
        var rto = cc.rotateTo(10,300);
        this.guang.runAction(rto);
    },
    continue(){
        var rto = cc.rotateTo(1,180);//旋转
        this.node.runAction(rto);
        var sby = cc.scaleBy(1,0.05);  //这是相乘的结果，2*3=6，即节点原始大小的6倍
        this.node.runAction(sby);
        let self = this;
        map.level += 1;
        var timer1=window.setTimeout(function (){
            self.node.destroy();
            cc.director.loadScene("game")
        },1000);
    },

    update (dt) {
        this.time += dt;
        if(this.move && this.time >= 0.01){
            this.node.y+=40;
            if(this.node.y >= 0){
                this.move = false;
            }
            this.time = 0;
        }
    },
});
